home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / inpt12.zip / INPUT.DOC next >
Text File  |  1991-10-09  |  15KB  |  351 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.        INPUT.EXE 1.2
  8.        Copyright 1991 by Chuck Steenburgh
  9.        
  10.           If you use batch files very often, you've probably acquired
  11.        a program called ASK.COM or QUERY.COM or something similar 
  12.        that allows you to ask questions and receive simple respones.
  13.        Usually, this involves typing an ECHO command with your
  14.        question, followed by ASK.COM or whatever.  If you do this
  15.        alot, you will probably appreciate the fact the INPUT.EXE
  16.        will accomplish the jobs of both the ECHO and ASK commands.
  17.        Add to this the greater flexibility that INPUT.EXE offers
  18.        in presenting your prompt to the user and in receiving input,
  19.        and you'll be sold.
  20.        
  21.        Usage:       INPUT ["prompt"] [color] [/c] [/i] [/s] [/y] [/n]  |
  22.        
  23.                  "prompt"        Enter the text you would like to
  24.                                  appear to prompt the user for
  25.                                  input.  This can be up to 59 char-
  26.                                  acters and must be enclosed in
  27.                                  quotation marks.
  28.        
  29.                  color           Enter a number representing the
  30.                                  color in which you want your mes-
  31.                                  sage to appear.  You must, of
  32.                                  course, have a color monitor and
  33.                                  card.  See Appendix 3.
  34.        
  35.                  /c              Include this switch if you want
  36.                                  your prompt message centered on
  37.                                  the current line.  If you include
  38.                                  this switch, you MUST include a
  39.                                  color value.
  40.                                  
  41.                  /s              Show keypress.  Adding this switch
  42.                                  will cause INPUT to display the
  43.                                  errorlevel value returned.  Use this
  44.                                  for quick "debugging" of your use
  45.                                  of INPUT.EXE
  46.                                  
  47.                  /i              Use this for a case-insensitive error
  48.                                  level return.  If this switch is
  49.                                  included on the command line, pressing
  50.                                  a letter a-z (lower case) will return
  51.                                  the same value as if the corresponding
  52.                                  key A-Z (upper case) were pressed.
  53.                                  
  54.                  /y              Use this for a yes-no only response.  |
  55.                                  If the "n" key is pressed, errorlevel |
  56.                                  of "0" is returned; pressing any other|
  57.                                  key returns an errorlevel of 1.  The  |
  58.                                  prompt "(Y/n)" is appended to the nor-|
  59.                                  mal prompt specified by the user.     |
  60.                                  
  61.  
  62.                                      Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                  /n              Use this for a yes-no only response.  |
  69.                                  If the "y" key is pressed, errorlevel |
  70.                                  of "1" is returned; pressing any other|
  71.                                  key returns an errorlevel of 0.  The  |
  72.                                  prompt "(y/N)" is appended to the nor-|
  73.                                  mal prompt specified by the user.     |
  74.                                  This switch takes precedence over the |
  75.                                  /y switch.                            |
  76.                                  
  77.                  The command line parameters may be entered in any
  78.                  order, may be in any case, and may be preceded by     |
  79.                  either the "/" or "-" character.                      |
  80.        
  81.        Examples:
  82.        
  83.             INPUT "Select a number from one to 10"
  84.        
  85.             This prints the text "Select on number from one to 10"
  86.        on the current line and waits for a keypress.
  87.        
  88.             INPUT "Press any key to continue" 79
  89.        
  90.             This prints the text "Press any key to continue" on the
  91.        current line in bright white on a red background and waits
  92.        for a keypress.
  93.        
  94.             INPUT "Press the space bar to exit" 143 /c
  95.        
  96.             This prints the text "Press the space bar to exit" cen-
  97.        tered on the current line in flashing bright white on a black
  98.        background.
  99.        
  100.             INPUT /s /i "Press any key..." /c 14
  101.             
  102.             Prompts user with "Press any key..." in yellow on black.
  103.        Returns a case-insensitive errorlevel and displays it on the
  104.        screen before terminating.
  105.        
  106.             INPUT "Do you wish to continue?" /s 79 /y                  |
  107.             
  108.             Prompts user with "Do you wish to continue? (Y/n)" in      |
  109.        white on red.  Returns errorlevel of 1 unless the "n" key is    |
  110.        pressed.  Displays errorlevel on screen.                        |
  111.        
  112.           INPUT will also sound an alarm to let the user know that
  113.        a response is expected.
  114.        
  115.           When a key is pressed, INPUT will set the errorlevel equal
  116.        to the ASCII value of the key pressed.  This is slightly dif-
  117.        ferent from BATBOX in that in normal operation INPUT is case
  118.        sensitive and will allow you to distinguish between upper and
  119.        lower case letters.  If you want a case-insensitive return, use
  120.        the /i switch.  See Appendix 2 for a complete list of the ASCII
  121.        characters theoretically supported by INPUT.
  122.  
  123.                                      Page 2
  124.  
  125.  
  126.  
  127.  
  128.  
  129.        
  130.           If you want greater control over the placement of your prompt
  131.        message on the screen, use WRITE in conjunction with INPUT.
  132.        Use WRITE to display your prompt then use INPUT without the
  133.        "prompt," color, or /c parameters.
  134.        
  135.        
  136.           INPUT is part of STEENBURGH'S STUFF Mildly Useful Utilities.
  137.        STEENBURGH'S STUFF includes the following programs:
  138.        
  139.             BATBOX:     Simple menu creation/input system
  140.             CLK:        Displays time on screen
  141.             FREEDISK:   Checks for available disk space
  142.             INPUT:      Simple prompt/input system
  143.             KLS:        Colorful screen-clearing utility
  144.             LAUNCHER:   File selection/execution system
  145.             MUSIC11:    Plays transcribed sheet music on the PC
  146.             RAND:       Random number generator
  147.             SKIP:       Prints blank lines from batch files
  148.             SOUNDER:    Wide range of noise making options
  149.             WAITFOR:    Timed pauses 
  150.             WHENISIT:   Date/time telling utility
  151.             WRITE:      Colorful output anywhere on screen
  152.             XD:         Create/switch directories at the same time
  153.        
  154.           The current version of STEENBURGH'S STUFF is 1.5, and can
  155.        be found on many BBS's as STUF15.ZIP (earlier versions include
  156.        STUF14.ZIP, STUF13.ZIP, etc.).  It can also be found on Compu-
  157.        Serve in the IBMSYS libraries.
  158.        
  159.        DISCLAIMER
  160.        
  161.           The programs described in this documentation are guaran-
  162.        teed to absolutely nothing!  They have, however, in my exper-
  163.        ience performed essentially as described herein.  The author
  164.        will not be responsible for any loss or damages caused through
  165.        the use of these programs.
  166.        
  167.           All trademarks are property of their respective owners.
  168.        
  169.           The programs and documentation are Copyright 1991 by Chuck
  170.        Steenburgh.  You are encouraged to distribute these programs
  171.        provided the following conditions are met:
  172.        
  173.           - all files contained in this archive must be distrib-
  174.             uted together in UNMODIFIED form
  175.        
  176.           - you charge no more than a reasonable fee for copying or
  177.             subscription, and clearly indicate that payment of such
  178.             a fee does NOT grant ownership of the programs.
  179.        
  180.           You may evaluate these programs for up to 30 days on a free
  181.        trial basis.  After 30 days, you should register your use of
  182.        these programs.  The registration fee is $10, payable to the
  183.  
  184.                                      Page 3
  185.  
  186.  
  187.  
  188.  
  189.  
  190.        author at the address given below.  This registration fee in-
  191.        cludes registration of ALL the programs described above as
  192.        part of STEENBURGH'S STUFF.
  193.        
  194.           Let's be real: I don't plan to make alot of money this way.
  195.        Registration does have its advantages:
  196.        
  197.           - I am improving these programs all the time.  Registration
  198.             will get you IMMEDIATELY a disk with the latest version,
  199.             which includes a version of BATBOX with user-selected 
  200.             menu colors.  When Version 2.0 of these utilities is re-
  201.             leased, you will also receive that free of charge.
  202.        
  203.           - While I can't promise to include everyone's suggestions
  204.             in program updates, you can bet I'll listen to registered
  205.             users before any of you scrounges out there.
  206.        
  207.           - You will me feel all warm and fuzzy and appreciated, and
  208.             all that good stuff.
  209.        
  210.           - You will also get an evaluation copy of my text-file for-
  211.             matting program (used to produce the margins in this doc-
  212.             ument).
  213.        
  214.           Send comments/registrations to:
  215.        
  216.                Chuck Steenburgh
  217.                304A North Main Street
  218.                Lexington, VA 24450
  219.                (703)464-5290
  220.        
  221.                CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
  222.        
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.                                      Page 4
  246.         
  247.         
  248.         APPENDIX 2
  249.         
  250.              Errorlevel Codes Produced by INPUT
  251.         
  252.            Code        Key Pressed    Code        Key Pressed 
  253.            ====        ===========    ====        =========== 
  254.              1            Ctrl-A        2           Ctrl-B
  255.              3            Ctrl-C        4           Ctrl-D
  256.              5            Ctrl-E        6           Ctrl-F
  257.              7            Ctrl-G        8           Ctrl-H
  258.              9            Ctrl-I       10           Ctrl-J
  259.             11            Ctrl-K       12           Ctrl-L
  260.             13            Ctrl-M       14           Ctrl-N
  261.             15            Ctrl-O       16           Ctrl-P
  262.             17            Ctrl-Q       18           Ctrl-R
  263.             19            Ctrl-S       20           Ctrl-T
  264.             21            Ctrl-U       22           Ctrl-V
  265.             23            Ctrl-W       24           Ctrl-X
  266.             25            Ctrl-Y       26           Ctrl-Z
  267.             27             ESC         28           Ctrl-\
  268.             29            Ctrl-]       30           Ctrl-^
  269.             31            Ctrl-_       32           (space)
  270.             33              !          34              "
  271.             35              #          36              $
  272.             37              %          38              &
  273.             39              '          40              (
  274.             41              )          42              *
  275.             43              +          44              ,
  276.             45              -          46              .
  277.             47              /          48              0
  278.             49              1          50              2
  279.             51              3          52              4
  280.             53              5          54              6
  281.             55              7          56              8
  282.             57              9          58              :
  283.             59              ;          60              <
  284.             61              =          62              >
  285.             63              ?          64              @
  286.             65              A          66              B
  287.             67              C          68              D
  288.             69              E          70              F
  289.             71              G          72              H
  290.             73              I          74              J
  291.             75              K          76              L
  292.             77              M          78              N
  293.             79              O          80              P
  294.             81              Q          82              R
  295.             83              S          84              T
  296.             85              U          86              V
  297.             87              W          88              X
  298.             89              Y          90              Z
  299.             91              [          92              \
  300.             93              ]          94              ^
  301.             95              _          96              `
  302.         
  303.         
  304.             
  305.             97              a          98              b
  306.             99              c         100              d
  307.            101              e         102              f
  308.            103              g         104              h
  309.            105              i         106              j
  310.            107              k         108              l
  311.            109              m         110              n
  312.            111              o         112              p
  313.            113              q         114              r
  314.            115              s         116              t
  315.            117              u         118              v
  316.            119              w         120              x
  317.            121              y         122              z
  318.            123              {         124              |
  319.            125              }         126              ~
  320.              
  321.              
  322.         
  323.         
  324.         APPENDIX 3
  325.         
  326.              Colors for INPUT and WRITE
  327.              
  328.              BACKGROUND COLOR + FORGEGROUND COLOR + SPECIAL COLOR
  329.              
  330.              Background Colors    Foreground Colors   Special
  331.              
  332.                0   Black            0   Black        128   Blink
  333.               16   Blue             1   Blue           8   Bright
  334.               32   Green            2   Green
  335.               48   Cyan             3   Cyan
  336.               64   Red              4   Red
  337.               80   Magenta          5   Magenta
  338.               96   Brown            6   Brown
  339.              112   Gray (White)     7   White
  340.              
  341.         Examples:
  342.         
  343.               Gray on Black:     0 + 7 = 7
  344.               
  345.               Bright Blue on Brown:     96 + 1 + 8 = 105
  346.               
  347.               Blinking Red on Green:     32 + 4 + 128 = 164
  348.               
  349.               Blinking Bright White on Red:     64 + 7 + 128 + 8 = 207
  350.               
  351.